package com.systar.activity.report.actions;

import java.io.IOException;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.systar.activity.report.ActivityDataPool;
import com.systar.activity.report.RequestParameter;

/**
 * Interface to process a request
 * Note that ActionProcessor classes must be state-less since they are get from an enum (static) 
 */
public interface ActionProcessor
{
	/**
	 * Process a request to a response
	 * @param request the HTTP request
	 * @param response the HTTP response
	 * @param parameters the request parameters
	 * @param data the data storage
	 * @throws ServletException if Servlet fails
	 * @throws IOException if fails to write in response
	 */
    void process(final HttpServletRequest request, final HttpServletResponse response,
    		final Map<RequestParameter,String> parameters, final ActivityDataPool data)
            throws ServletException, IOException;

}
